package com.tuishan.myapplication.ViewModels;

import androidx.lifecycle.MutableLiveData;
import androidx.paging.DataSource;

import com.blankj.utilcode.util.LogUtils;
import com.tuishan.myapplication.Model.UserLogModel;

/**
 * <pre>
 *     time   : 2021/04/17
 *     desc   :
 *     version: 1.0
 * </pre>
 */

public class UserLogFactory extends DataSource.Factory<Integer, UserLogModel> {
    private MutableLiveData<UserLogDataSource> mSourceLiveData =
            new MutableLiveData<>();
    private int MyType;

    public UserLogFactory() {
        MyType = 0;
    }

    public UserLogFactory(int ar1) {
        this.MyType = ar1;
    }

    @Override
    public DataSource<Integer, UserLogModel> create() {
        UserLogDataSource concertDataSource = new UserLogDataSource(MyType);
        mSourceLiveData.postValue(concertDataSource);
        return concertDataSource;
    }
}
